/* indent size: 2 */

module.exports = app => {
  const DataTypes = app.Sequelize;

  const Model = app.model.define('admin', {
    admin_id: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
      primaryKey: true,
      autoIncrement:true
    },
    account: {
      type: DataTypes.STRING(16),
      allowNull: false
    },
    pwd: {
      type: DataTypes.STRING(100),
      allowNull: false
    },
    status: {
      type:DataTypes.INTEGER(4),
      allowNull: false,
      defaultValue:1
    },
    town_id: {
      type: DataTypes.INTEGER(11),
      allowNull: false,
    },
    ctime: {
      type: DataTypes.TIME,
      allowNull: false,
      defaultValue:DataTypes.literal('CURRENT_TIMESTAMP')
    },
    mtime: {
      type: DataTypes.TIME,
      allowNull: false,
      defaultValue:DataTypes.literal('CURRENT_TIMESTAMP')
    }
  }, {
    tableName: 'admin'
  });

  Model.associate = function() {

  }

  return Model;
};
